package com.yx.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yx.common.vo.Result;
import com.yx.sys.entity.Reply;
import com.yx.sys.mapper.ReplyMapper;
import com.yx.sys.service.IReplyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 回复 服务实现类
 * </p>
 *
 * @author yx
 * @since 2023-02-14
 */
@Service
public class ReplyServiceImpl extends ServiceImpl<ReplyMapper, Reply> implements IReplyService {
    @Autowired(required = false)
    private ReplyMapper replyMapper;

    @Override
    public List<?> getReplyMes(Integer status) {
        List<?> list = replyMapper.selectReplyMes(status);
        return list;
    }

    @Override
    public Map<String,Object> getParentByrId(Integer childId) {
        Map<String,Object> parentMes = replyMapper.selectParentByrId(childId);
//        System.out.println("评论："+parentMes);
        return parentMes;
    }

    @Override
    public List<Reply> getReplyBypId(Integer pId) {
        List<Reply> reply = replyMapper.selectReplyBypId(pId);
        return reply;
    }

    @Override
    public List<?> getReplyByuId(Integer uId) {
        List<?> list = replyMapper.selectReplyByuId(uId);

        return list;
    }
}
